#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using pii = std::pair<int, int>;
std::vector<pii> tmp;

int main() {
    string s;
    cin >> s;
    int left = 0, right = 1;
    int len = 0;
    while (right < s.size()){
        while (right < s.size() && s[right - 1] + 1 == s[right]) right++;
        len = max(len, right - left);
        tmp.emplace_back(left, len);
        left = right;
        right++;
    }
    std::sort(tmp.begin(), tmp.end(), [](pii& x, pii& y){
        return x.second > y.second;
    });
    size_t pos = tmp[0].first, n = tmp[0].second;
    cout <<  s.substr(pos, n) << endl;
}
// 64 位输出请用 printf("%lld")